﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MyVoteMVC.Domain;
using System.Data.Entity.ModelConfiguration;

namespace MyVoteMVC.Data.Mapping
{
    public class VT_DictionariesMap : EntityTypeConfiguration<VT_Dictionaries>
    {
        public VT_DictionariesMap()
        {
            // Primary Key
            this.HasKey(t => t.Dictionary_ID);

            // Properties
            this.Property(t => t.Dictionary_Name)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.Dictionary_Order);

            this.Property(t => t.Dictionary_Type)
                .HasMaxLength(50);

            this.Property(t => t.Dictionary_Value)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("VT_Dictionaries");
            this.Property(t => t.Dictionary_ID).HasColumnName("Dictionary_ID");
            this.Property(t => t.Dictionary_Name).HasColumnName("Dictionary_Name");
            this.Property(t => t.Dictionary_Order).HasColumnName("Dictionary_Order");
            this.Property(t => t.Dictionary_Type).HasColumnName("Dictionary_Type");
            this.Property(t => t.Dictionary_Value).HasColumnName("Dictionary_Value");
        }
    }
}
